#ifndef DEFAULT_H
#define DEFAULT_H

#include <QDir>
#include <QIcon>
#include <QDebug>
#include <QSettings>
#include <QApplication>


#define QT_USE_FAST_CONCATENATION
#define QT_USE_FAST_OPERATOR_PLUS



class Config : public QSettings
{
	Q_OBJECT

public:

	enum { MinWordLength = 2 };

	Config (QObject* parent)  : QSettings (parent) {}

	static const QString appVersion () { return "2014.03.21"; }
	static const QString appName () { return "mcroises"; }

	static const QChar m_joker;
	static const QChar m_blankDisplay;

	static const QStringList dicoFileFilter() { return QStringList() << "*.dic"; }
	static const QString officialRefDicosPath ();
	static const QString userHomePath () { return QDir::toNativeSeparators (QDir::homePath () + '/'); }
	static const QString appHomePath () { return QDir::toNativeSeparators (userHomePath () + '.' + appName () + '/'); }
	static const QString annexeDico () { return appHomePath () + "annexe.dic"; }
	static const QString refDicsPath () { return QDir::toNativeSeparators (appHomePath () + "refdics/"); }
	static const QIcon appIcon () { return QIcon (":/images/" + appName () + ".png"); }
	static const QIcon dicIcon () {
		return QIcon::fromTheme ("accessories-dictionary", QIcon ("://images/accessories-dictionary.svg"));
	}

	//----------------------------------------

	QString currentRefDico ();
	bool alertOverwriteReference ();
	bool useDamerauTest();
	bool displayExecTime();
	int letterCount ();

public slots:
	void setCurrentRefDico (const QString& fileName);
	void setAlertOverWriteReference (bool b);
	void setUseDamerauTest (bool b);
	void setDisplayExecTime(bool b);
	void setLetterCount (int count);
};

#endif // DEFAULT_H
